<!DOCTYPE html>
<html>
<head lang="en">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="css/index2.css"/>
    <style>
        body{
            max-width: 540px;
            min-width:320px;
            margin:0 auto;
        }
        .Header .fixed_header{
            max-width: 540px;
            min-width:320px;
            margin:0 auto;
        }
        .Header .fixed_header .header_main .page_title{
            max-width: 540px;
            min-width:320px;
            margin:0 auto;
            padding:0;
            float: none;
            text-align: center;
        }
        #showpage{
            max-width: 540px;
            min-width: 320px;
            margin: 0 auto;
            position:absolute;
            top:44px;
            bottom:0;
            left:0;
            right:0;
            background:#fff;
        }
        .QuestionTopics.has_topics{
            overflow: hidden;
        }
        .QuestionPreview {
            padding-top: 5px;
        }
        .QuestionTopics.has_topics {
            overflow: hidden;
        }
        .QuestionTopics.has_topics span {
            font-size: 12px;
            color: #808393;
            padding: 3px 8px;
            background: #f4f4fa;
            font-weight: 500;
            word-break: break-all;
            -webkit-tap-highlight-color: rgba(255,255,255,0.6);
            border-radius: 12px;
            margin-right: 8px;
            margin-top: 5px;
            float: left;
        }
        .qimgs {
            overflow: hidden;
        }
        .senderinfo {
            overflow: hidden;
            margin-top: 5px;
        }
        .senderinfo div {
            position: relative;
        }
        .senderinfo .lf img {
            height: 16px;
            width: 16px;
        }
        .senderinfo .lf span {
            position: absolute;
            top: 1px;
            left: 17px;
            color: #F4C600;
        }
        .senderinfo .rt span {
            color: #999;
            font-size: 12px;
        }
        .senderinfo .rt span a {
            color: #999;
            font-size: 12px;
        }
        .qtext_para>img {
            width: 28px;
            height: 28px;
            margin-top: -3px;
        }
    </style>
</head>
<body>
<header class="Header" id="header">
    <div class="fixed_header">
        <div class="header_main mweb_lookup_bar_has_input">
            <div class="page_title">铺路分享</div>
        </div>
    </div>
</header>
<!---->
<!-- 页面部分-->
<div id="showpage">
    <!-- 问题部分-->
    <div class="QuestionPreview" style="border-bottom:none;">
        <div class="question_topics_container">
            <div class="QuestionTopics has_topics">

            </div>
        </div>
        <div class="qtext_para getcontent">

        </div>
        <!-- 图片部分-->
        <div class="qtext_para qimgs" id="qimgsplace">

        </div>
        <!--定位部分-->
        <div class="locationplace" style="display: none;">
            <img src="img/dingwei.png"/>
            <span></span>
        </div>
        <!-- 发布者信息部分-->
        <div class="senderinfo">
            <div class="lf" style="display:block ">
                <img src="img/money04.png"/>
                <span></span>
            </div>
            <div class="rt">
                <span id="sendernick"></span> ·
                <span id="sendertime"></span>
            </div>
        </div>
    </div>
</div>
<!---->
<div id="weixinshare" style="position:fixed;top:250px;left:200px;width:150px;height:50px;border:1px solid red;background-color: green">微信推送测试</div>

<script src="js/jquery-1.11.3.js"></script>
<script src="js/jquery.cookie.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script src="ftnjs/urlnote.js"></script>
<script src="ftnjs/changetimeftn.js"></script>
<script src="ftnjs/sendfaceftn.js"></script>
<script>
    var senddata={
        "touser":"oZi9sxJ10hj3QtEuS8mMk6LNcuXA",
        "template_id":"55YkfbjMX1JVK6NLZwoMHNFg4LsF8d9PZOZeLLn2erY",
        "url":"http://www.pulu.com/weixin/shareexppage.html?eid=924",
        "topcolor":"#FF0000",
        "data":{
            "User": {
                "value":"黄先生",
                "color":"#173177"
            },
            "Date":{
                "value":"06月07日 19时24分",
                "color":"#173177"
            },
            "CardNumber":{
                "value":"0426",
                "color":"#173177"
            },
            "Type":{
                "value":"消费",
                "color":"#173177"
            },
            "Money":{
                "value":"人民币260.00元",
                "color":"#173177"
            },
            "DeadTime":{
                "value":"06月07日19时24分",
                "color":"#173177"
            },
            "Left":{
                "value":"6504.09",
                "color":"#173177"
            }
        }
    };
    $("#weixinshare").click(function(){
        $.ajax({
            type:"post",
            url:"https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=ACCESS_TOKEN",
            data:senddata,
            success:function(d){
                console.log(d);
            }
        })
    });
    //获得经验
    $.ajax({
        type:"post",
        url:getdetialurl,
        data:{"questionId":"924"},
        datatype: "json",
        success:function(data){
            console.log("经验数据：");
            $("title").html(data.Data.Pulu_Question.title);
            console.log(data.Data);
            euserid=data.Data.Pulu_Question.questionUserId;
            var label=data.Data.Pulu_Question.hobbytypenames+","+data.Data.Pulu_Question.jobtypenames;
            var reg1=/([A-Za-z0-9\u4E00-\u9FA5]*)/;
            var word=label.match(reg1);
            //console.log(word);
            for(var i=0;i<word.length;i++){
                word[i].index=i;
                if(word[i]!=="null"){
                    console.log("判断唯空："+i+":"+word[i]);//.TopicListItems2
                    $(".QuestionTopics.has_topics").append("<a class='TopicNameLink HoverMenu topic_name'>"+word[i]+"</a>")
                }else if(!word[i]){
                    console.log("空");
                }
            }
            upers=data.Data.userList;
            if(data.Data.Pulu_Question.keywords&&data.Data.Pulu_Question.keywords.length>0){
                var keywords=data.Data.Pulu_Question.keywords;
                if(keywords.match(/，/)){
                    if(keywords.match(/，/)){
                        keywords=keywords.replace(/，/g,",");
                    }
                    keywords=keywords.split(",");
                    console.log(keywords);
                    for(var k=0;k<keywords.length;k++){
                        $(".QuestionTopics.has_topics").append("<span>"+keywords[k]+"</span>")
                    }
                }else{
                    keywords=keywords.split(",");
                    console.log(keywords);
                    for(var k=0;k<keywords.length;k++){
                        $(".QuestionTopics.has_topics").append("<span>"+keywords[k]+"</span>")
                    }
                }
            }
            if(data.Data.Pulu_Question.pululocation&&data.Data.Pulu_Question.pululocation.length>0){
                $(".locationplace").css("display","block");
                $(".locationplace span").html(data.Data.Pulu_Question.pululocation);
            }
            $(".allgetmoney").html("总收入"+parseFloat(data.Data.expEarnScore)/100+"元");
            var facecode=codetoface(data.Data.Pulu_Question.content);
            $(".getcontent").html(facecode);
            $("#countnum").html(data.Data.userList.length);
            $(".senderinfo .lf span").html(parseFloat(data.Data.Pulu_Question.score)/100);//经验有多少钱
            var money=parseFloat(data.Data.Pulu_Question.score);
            if(data.Data.Pulu_Question.ishidename==1){
                $(".senderinfo .rt #sendernick").append("<a>匿名</a>");
            }else{
                $(".senderinfo .rt #sendernick").append(data.Data.user.nick);
            }
            var sendtime="";
            if(data.Data.Pulu_Question.etime){
                sendtime=getDateDiff(getDateTimeStamp(data.Data.Pulu_Question.etime));
            };
            function showtime(){
                if(sendtime&&sendtime.length>0){
                    $(".senderinfo .rt #sendertime").html(sendtime);
                }else{
                    $(".senderinfo .rt #sendertime").html("刚刚");
                }
            };
            showtime();
            $("#sharetitleword div").html(data.Data.Pulu_Question.title);
            if(data.Data.ImgList){
                for(var r=0;r<data.Data.ImgList.length;r++){
                    $("#qimgsplace").append("<div class='imgbox'><img src='http://42.62.66.198:8003/"+data.Data.ImgList[r].imgPath+"'/></div>");
                }
                var showimgwidth=$(".qimgs .imgbox").width();
                $(".qimgs .imgbox").height("auto");
            }
        }
    });
</script>
</body>
</html>